package com.example.demo.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import javax.net.ssl.HttpsURLConnection;
import java.net.URL;
import java.time.Duration;

public class JDBCUtils {

    public static void main(String[] args) throws Exception {

//        Flux.just(1, 2).concatWith(Mono.error(new IllegalArgumentException()));
////                .concatWith(Flux.just(5,6))
////                .onErrorContinue()
////                .subscribe(System.out::println);
//
//        Logger log = LoggerFactory.getLogger(JDBCUtils.class);
//
//        Flux.range(1, 20)
//                .map(i -> {
//                    if (i % 2 == 0) throw new RuntimeException("fake a mistake");
//                    return String.valueOf(i);
//                })
//                .map(Object::toString)
//                // 遇到error之后跳过，可以通过不同错误类型做不同处理
//                .onErrorContinue((err, val) -> log
//                        .error("处理第{}个元素时遇到错误，错误类型为：{}， 错误信息为： {}", val, err.getClass(), err.getMessage()))
//                .subscribe(log::info);
//
//        try {
//            Thread.sleep(2000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }



        URL url=new URL("urlpath");
        HttpsURLConnection connection=(HttpsURLConnection) url.openConnection();

    }

    public static class User {
        private String name;
        private Integer age;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Integer getAge() {
            return age;
        }

        public void setAge(Integer age) {
            this.age = age;
        }

        @Override
        public String toString() {
            return "User{" +
                    "name='" + name + '\'' +
                    ", age=" + age +
                    '}';
        }
    }
}